<!DOCTYPE html>
<html>
<head>
    <title>Snake game</title>
    <script src="../jquery-1.9.0.min.js"></script>
    <script src="snake.js"></script>
</head>
<body onload="onLoad()">

<script>
$(document).ready(function(){
    $(document).keydown(function(e) {
        switch (e.keyCode) {
            case 37:$(document).trigger('arrow_left');    break;
            case 38:$(document).trigger('arrow_up');      break;
            case 39:$(document).trigger('arrow_right');   break;
            case 40:$(document).trigger('arrow_down');    break;
        }
    });
});
</script>

<canvas id="snake" width="800" height="600" style="border: 3px solid black"></canvas>

</body>
</html>